package com.gongpingjialoan.bean;

import android.text.TextUtils;

import java.io.Serializable;

/**
 * Created by Administrator on 2016/4/18.
 */
public class HistoryModel implements Serializable{

    private String mBrandName;
    private String mBrandSlug;
    private String mModelName;
    private String mModelSlug;


    public String getBrandName() {
        return mBrandName;
    }

    public void setBrandName(String brandName) {
        mBrandName = brandName;
    }

    public String getBrandSlug() {
        return mBrandSlug;
    }

    public void setBrandSlug(String brandSlug) {
        mBrandSlug = brandSlug;
    }

    public String getModelName() {
        return mModelName;
    }

    public void setModelName(String modelName) {
        mModelName = modelName;
    }

    public String getModelSlug() {
        return mModelSlug;
    }

    public void setModelSlug(String modelSlug) {
        mModelSlug = modelSlug;
    }


    @Override
    public int hashCode() {
        if(TextUtils.isEmpty(mModelSlug)){
            return mBrandSlug.hashCode();
        }else{
            return mModelSlug.hashCode();
        }
    }

    @Override
    public boolean equals(Object o) {
        if (this == o)
        {
            return true;
        }
        if (o.getClass() == HistoryModel.class)
        {
            HistoryModel n = (HistoryModel)o;
            return n.mModelSlug.equals(mModelSlug);
        }
        return false;
    }
}
